import z from "zod";

import { valid_base_string, valid_public_id } from "./core/index.ts";

export const newDictValid = z.object({
  /** 字典名称 - 填写、字符串、长度1-24 */
  name: valid_base_string("字典名称", "1-24"),
  /** 字典值 - 填写、字符串、长度1-24 */
  value: valid_base_string("字典值", "1-24"),
  /** 字典描述 - 填写、字符串、长度1-24 */
  parentId: valid_public_id("字典描述").optional(),
});
export interface IReqCreateDict extends z.infer<typeof newDictValid> {}
export interface IReqUpdateDict extends IReqCreateDict {
  _id: string;
}
export interface IRspDict extends IReqUpdateDict {}

export default {
  create: newDictValid, // 创建字典
  update: null, // 更新字典
  delete: null, // 删除字典
};
